#include "LED_Blink.h"

LED_Blink::LED_Blink(int ledPin)
{
  this->ledPin = ledPin;
  pinMode(ledPin, OUTPUT);
}

LED_Blink::LED_Blink(int ledPin, int interval)
{
  this->ledPin = ledPin;
  this->interval = interval;
}

void LED_Blink::blink()
{
  digitalWrite(ledPin, HIGH);
  delay(interval);
  digitalWrite(ledPin, LOW);
  delay(interval);
}

void LED_Blink::breath()
{
    int light = 0;
    while(light < 255) {
    analogWrite(ledPin, light);
    delay(50);
    light = light + 10;
    if(light >= 255) {
      light = 255;
    }
  }

  while(light > 0) {
    delay(50);
    light = light - 10;
    if(light <= 0) {
      light = 0;
    }
    analogWrite(ledPin, light);
  }
}
